import { proxy } from 'valtio';
import CardService from '../../cards/base/service';
import TabService from '../../tabs/base/service';
import BasePanelService from '../base/service';
import { cards } from '../../cards';
import { controls } from '../../controls';

// 热刷新存在问题，文件会重新加载，但不会自动重新进入构造函数

class UserTask extends BasePanelService {
  title = '任务设置';

  tabs = [
    // 在这里使用proxy，可以减少父组件的render次数
    proxy(
      new TabService({
        title: '基础',
        cards: [
          cards.general,
        ],
      })
    ),
    proxy(
      new TabService({
        title: '参与人',
        cards: [
          new CardService({
            title: '人员',
            controls: [
              controls.approval.user,
              controls.approval.approvalType,
              controls.approval.remarkIsRequired,
              controls.divider,
              // controls.cc.user,
              controls.cc.customCc
            ],
          }),
          cards.setting
        ],
      })
    ),
  ];

  // render() {
  //     return <ProCard>
  //       {this.tabs.map((tab,key) => tab.render({key:'cardKey'+key}))}
  //     </ProCard>;
  // }
}

export default UserTask;
